package com.weixin.dao;

import java.sql.SQLException;
import java.util.List;

import com.weixin.entity.User_Tb;

public interface User_TbDAO {
	/**
	 * 查询用户所有信息
	 * @return
	 * @throws SQLException
	 */
      public List<User_Tb> seletct() throws SQLException;
     /**
      * 插入用户数据
      * @param user_tb
      * @return
      * @throws SQLException
      */
      public int insert(User_Tb user_tb)throws SQLException;
     /**
      * 通过id查询用户单条数据 ,修改单行数据
      * @param 
      * @return
      * @throws SQLException
      */
      public User_Tb getById(int id)throws SQLException;
      /**
       * 修改用户数据
       * @param user_tb
       * @return
       * @throws SQLException
       */
      public boolean update(User_Tb user_tb)throws SQLException;
      /**
       * 通过id删除数据
       * @param id
       * @return
       * @throws SQLException
       */
      public boolean delete(int id) throws SQLException;
      /**
       * 通过ID删除选中的所有数据
       * @param ids
       * @return
       * @throws SQLException
       */
      public boolean deleteAll(List<String> ids)throws SQLException;
      /**
       * 查询用户和账号
       * @param name
       * @param password
       * @return
       * @throws SQLException
       */
      public User_Tb selectmp(String name,String password)throws SQLException;
      /**
       * 通过角色查询所有信息
       * @param role
       * @return
       * @throws SQLException
       */
      
      public List<User_Tb> listRole(String role)throws SQLException;
      
      
      
      /**
  	 * 通过角色名查找对应的用户，然后分页
  	 * @param pageSize
  	 * @param pageNum
  	 * @return
  	 * @throws SQLException
  	 */
  	public List<User_Tb> selectAllByRolePagination(String role,int pageSize,int pageNum)throws SQLException;
	
  	
  	/**
	 * 查找某个角色的总条数
	 * @param role
	 * @return
	 * @throws SQLException
	 */
	public int selectTotal(String role)throws SQLException;
	
	
	/**
	 * 通过角色名和关键字查找对应的用户，然后分页
	 * @param role
	 * @param search
	 * @param pageSize
	 * @param pageNum
	 * @return
	 * @throws SQLException
	 */
	public List<User_Tb> selectAllByRoleSearchPagination(String role,String search,int pageSize,int pageNum)throws SQLException;
	
	
	/**
	 * 通过关键字查找某个角色的总条数
	 * @param role
	 * @return
	 * @throws SQLException
	 */
	public int selectTotalBySearch(String role,String search)throws SQLException;
	
	
	public User_Tb xiugai(String name)throws SQLException;
	
	public User_Tb yz(String question1, String answer1,String question2,String answer2,String name)throws SQLException;
	
	public boolean pwdnew(User_Tb user_tb) throws SQLException;
}
